package com.github.pavlospt.slice;

import com.github.pavlospt.CircleView;
import com.github.pavlospt.ResourceTable;

import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.window.service.DisplayManager;

/**
 * MainAbilitySlice
 *
 * @since 2021-06-15
 */
public class MainAbilitySlice extends AbilitySlice {
    private CircleView circleView;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        circleView = (CircleView) findComponentById(ResourceTable.Id_circle_view);
        int width = DisplayManager.getInstance().getDefaultDisplay(this)
                .get().getAttributes().width;
        int height = DisplayManager.getInstance().getDefaultDisplay(this)
                .get().getAttributes().height;
        circleView.setWeight(width);
        circleView.setHeight(height/2);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
